/** When your routing table is too long, you can split it into small modules**/
import pageComponentName from '@/config/page-component-name'
import Layout from '@/layout/index.vue'

const commodiRouter = [
  {
    path: '/commodity',
    component: Layout,
    name: 'commodity',
    meta: { title: '商品管理', icon: 'Present', keepAlive: true },
    children: [
      {
        path: 'commodi',
        component: () => import('@/views/commodity/index.vue'),
        name: 'commodi',
        meta: {
          title: '商品资料',
          icon: 'Present',
          keepAlive: true,
          componentName: pageComponentName.good.goodList,
        },
      },
      {
        path: '/commodity/commodi/1',
        component: () => import('@/views/commodity/addgoods/index.vue'),
        name: 'commodity1',
        meta: {
          title: '新增成品',
          keepAlive: true,
          componentName: pageComponentName.good.goodForm,
        },
        hidden: true,
      },
      {
        path: '/commodity/commodi/edit/:id',
        component: () => import('@/views/commodity/addgoods/index.vue'),
        name: 'editCommodity',
        meta: {
          title: '修改成品',
          keepAlive: true,
          componentName: pageComponentName.good.goodForm,
        },
        hidden: true,
      },
      {
        path: '/commodity/commodi/2',
        component: () => import('@/views/commodity/addgoods/index.vue'),
        name: 'commodity2',
        meta: {
          title: '新增配件',
          keepAlive: true,
          componentName: pageComponentName.good.goodForm,
        },
        hidden: true,
      },
      {
        path: '/commodity/commodi/editSpare/:id',
        component: () => import('@/views/commodity/addgoods/index.vue'),
        name: 'editCommodity2',
        meta: {
          title: '修改配件',
          keepAlive: true,
          componentName: pageComponentName.good.goodForm,
        },
        hidden: true,
      },
      {
        path: '/commodity/commodi/detail/:id',
        component: () => import('@/views/commodity/addgoods/detail/index.vue'),
        name: 'detail',
        meta: {
          title: '商品详情',
          keepAlive: true,
          componentName: pageComponentName.good.goodDetail,
        },
        hidden: true,
      },
      // 品牌
      {
        path: '/commodity/brand',
        component: () => import('@/views/commodity/brand/index.vue'),
        name: 'brand',
        meta: {
          title: '品牌管理',
          keepAlive: true,
          componentName: pageComponentName.good.brandList,
        },
      },
      {
        path: '/busic/base/proset',
        component: () => import('@/views/busic/base/module/pro_set/index.vue'),
        name: 'proSet',
        meta: {
          title: '商品设置',
          keepAlive: true,
          componentName: pageComponentName.setting.goodSet,
        },
      },
      {
        path: '/commodity/addbrand',
        component: () => import('@/views/commodity/brand/add/index.vue'),
        name: 'addBrand',
        meta: {
          title: '添加品牌',
          keepAlive: true,
          componentName: pageComponentName.good.brandForm,
        },
        hidden: true,
      },
      {
        path: '/commodity/editbrand/:id',
        component: () => import('@/views/commodity/brand/add/index.vue'),
        name: 'editBrand',
        meta: {
          title: '修改品牌',
          keepAlive: true,
          componentName: pageComponentName.good.brandForm,
        },
        hidden: true,
      },
      {
        path: '/commodity/branddetail/:id',
        component: () => import('@/views/commodity/brand/detail/index.vue'),
        name: 'brandDetail',
        meta: {
          title: '品牌详细',
          keepAlive: true,
          componentName: pageComponentName.good.brandDetail,
        },
        hidden: true,
      },
      {
        path: '/commodity/branddetail/:id',
        component: () => import('@/views/commodity/brand/detail/index.vue'),
        name: 'brandDetail',
        meta: {
          title: '品牌详细',
          keepAlive: true,
          componentName: pageComponentName.good.brandDetail,
        },
        hidden: true,
      },
      {
        path: 'goodsExcelImport',
        component: () => import('@/views/excel/index.vue'),
        name: 'goodsExcelImport',
        meta: {
          title: '商品资料导入',
          keepAlive: true,
          componentName: pageComponentName.common.import,
        },
        hidden: true,
      },
    ],
  },
]

export default commodiRouter
